export const type = {
  SWITCH_MENU: 'SWITCH_MENU',
  USERINFO: 'USERINFO',
  LOGOUT: 'LOGOUT'
}

export function switchMenu(menuName) {
  return {
    type: type.SWITCH_MENU,
    menuName
  }
}

export function userInfo(userInfo) {
  localStorage.setItem('bikeCMS', JSON.stringify(userInfo))
  return {
    type: type.USERINFO,
    userInfo
  }
}

export function logoutAction() {
  localStorage.clear('bikeCMS')
  return {
    type: type.LOGOUT,
  }
}